import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
// vue使用插件语法
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: Home
  },
  {
    path: '/news',
    name: 'news',
    component: () => import('../views/News')
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})
export default router
